package com.example.rabbitmq.receiver;

import com.example.rabbitmq.bean.User;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Copyright(C), 2020-2021, AmbroseCdMeng
 * FileName:    ObjectReceiver
 * Author:      AmbroseCdMeng
 * Date:        2021/3/2 9:16
 * Description: 接收类。实现发送和接收对象
 * History:
 * <author>     <time>      <version>       <desc>
 * 作者姓名     修改时间        版本号           描述
 */
@Component
@RabbitListener(queues = "object")
public class ObjectReceiver {
    @RabbitHandler
    public void process(User user){
        System.out.println("Receiver object: " + user);
    }
}
